Skip to main content

0.11.0 -> 0.12.0

Before

    public interface IWebSocketSession
{
public event Action? Connected;
public event Action Disconnected;

public bool IsConnected { get; }
}

After

    public interface IWebSocketSession
{
public event Action? Connected;
public event Action<DisconnectionData>? Disconnected;

public bool IsConnected { get; }
}

public struct DisconnectionData
{
public readonly DisconnectionReason Reason;

}

public enum DisconnectionReason
{
Unknown = 0,
ClientRequest = 1,
ApplicationShutdown = 2,
Error = 3,
Closed = 4,
Reconnection = 5,
Timeout = 6,
}

Why?

We added the DisconnectionData parameter to the event to provide developers with detailed information about disconnection causes, enabling them to handle disconnections more effectively and improve the overall reliability and user experience of their applications.

What next?

Each event handler need to match event delegate:

Action<DisconnectionData>